**// Frequentist Regression
clear

cd "\\file\UsersW$\wrr15\Home\My Documents\My Files\REPLICATION OF ZIGRAIOVA AND HAVRANEK (2016)\REVISION FOR JOES"

log using "APPENDIX3&4.smcl", replace

use "Z&Hcompetition.dta"
set more off
xtset IDStudy
gen double lnobs = ln(Samplesize)
ivreg2 PCC SEPCC dummies Hstatistic developed undeveloped Logit lnobs ///
citations firstpub quadratic Boone IFrecursive regulation OLS ///
reviewed_journal [pweight=investperst], cluster (IDStudy)

clear
use "all.dta"
set more off
xtset IDStudy
gen double lnobs = ln(Samplesize)
gen invvariance = 1/(SEPCC^2)
**// Replication
ivreg2 PCC SEPCC Logit citations_2019 OLS reviewed_journal Concentration ///
global ownership firstpub lnobs IFrecursive_2019 DtoD FE Hstatistic endogeneity   ///
sampleyear HHI dummies macro [pweight=investperst], cluster (IDStudy)

**// Replication (WLS)
ivreg2 PCC lnobs firstpub quadratic Lerner Zscore profit_volat ///
SEPCC GMM NPL global DtoD Hstatistic sampleyear developed undeveloped ///
someAveraged OLS citations_2019 Boone capitalization reviewed_journal ///
RE profitability Concentration endogeneity ownership Logit ///
HHI SLS dummies T macro FE IFrecursive_2019 regulation[pweight=invvariance], cluster (IDStudy)

log close
